if DEDICATED then
  return love
end

-- Make a copy of the love namespace

local love = {}
for k, v in pairs(_G.love) do
  love[k] = v
end
love.graphics = {}
for k, v in pairs(_G.love.graphics) do
  love.graphics[k] = v
end

-- Monkey-patch the colour functions
do
  function love.graphics.setColor(r, g, b, a)
    if type(r) == "table" then
      r, g, b, a = r[1], r[2], r[3], r[4]
    end
    _G.love.graphics.setColor(r * 0.003922, g * 0.003922, b * 0.003922, a and a * 0.003922 or 1)
  end

  function love.graphics.setBackgroundColor(r, g, b, a)
    if type(r) == "table" then
      r, g, b, a = r[1], r[2], r[3], r[4]
    end
    _G.love.graphics.setBackgroundColor(r * 0.003922, g * 0.003922, b * 0.003922, a and a * 0.003922 or 1)
  end
end

return love
